<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>修改企业基本信息</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="${ctx}/css/ui.datepicker.css" rel="stylesheet" type="text/css" media="screen" charset="utf-8" />
	<script src="${ctx}/js/table.js" type="text/javascript" language="javascript"></script>
	<script src="${ctx}/js/jquery-1.5.2.js" type="text/javascript" charset="utf-8"></script>
	<script src="${ctx}/js/ui.datepicker.js" type="text/javascript" charset="utf-8"></script>	
	<script src="${ctx}/js/ui.datepicker-zh-CN.js" type="text/javascript" charset="utf-8"></script>	
	<script src="${ctx}/js/help.js" type="text/javascript" ></script>
<script language="javascript" type="text/javascript">
function validate()
{    var j=document.getElementById("t2").value;
     var l=document.getElementById("t1").value;
     document.form1.bu_idNumber.value=j+l;
     if(document.getElementById("bu_payerName").value==""){
     alert("纳税人名称 不能为空，请输入");
     return false;}
	  if(document.form1.t1.value==""){
     alert("请输入企业编号！");
     return false;}
	     if(document.form1.t1.value.length!=9){
		     alert("企业编号长度为9位数字！");
		     return false;}
	  if(document.getElementById("bu_manageType").value==""){
     alert("企业经营方式 不能为空，请输入");
     return false;}
     if(document.getElementById("bu_trade").value==""){
     alert("所属行业 不能为空，请输入");
     return false;}
     if(document.getElementById("bu_levyType").value==""){
     alert("企业征税方式 不能为空，请输入");
     return false;}
     if(document.getElementById("bu_amount").value==""){
     alert("资产总额 不能为空，请输入");
     return false;}
     if( parseInt(document.getElementById("bu_regMoney").value) >  parseInt(document.getElementById("bu_amount").value)){
         alert("资产总额比注册资本要高");
         return false;}
	 
     if(document.getElementById("bu_phone").value==""){
     alert("联系方式 不能为空，请输入");
     return false;}
	 return true;
 }
function checkByName()
{
	var taxplayer = $("#bu_payerName").val();
    $.ajax({   
        url:"${ctx}/taxmanage/tmCompInfo_check.action",   
        type:"post",   
        data:{"taxplayer":$("#bu_payerName").val()},   
        dataType:"json",   
        success:function(data){  
             var k=typeof(data);
			 if(k=="object"){
			  $('#bu_businessType').val(data.bizEntity.regtype);
			  $('#bu_manageType').val(data.bizEntity.managetype);
			  $('#bu_regMoney').val(data.bizEntity.regcapital);
			  $('#bu_trade').val(data.bizEntity.trade);
			  $('#bu_phone').val(data.bizEntity.phone);
		     }
			 if(k=="string"){
				 alert(data);
			 }
          }    
     });   
 return false; 
}
</script>
</head>
  
  <body>
  <div id="content">
  <table width="1070" border="0" cellspacing="0">
  <tr>
    <td>
	<form id="form1" name="form1" action="${ctx}/manage/mcomp_update.action?entity.id=${entity.id}" method="post" onSubmit="return validate();">
	
	<fieldset>
	<legend></legend>
	<legend></legend>
	<legend></legend>
	<div align="center">
	  <legend>修改企业基本资料信息</legend>
	  <p>&nbsp;</p>
	</div>
	</fieldset>
	  <table width="822" border="0" align="center" style="font-size:13px; color:#333333">
  <tr>
    <td width="152" height="34" align="right">纳税人识别码：</td>
    <td colspan="2"><input name="entity.taxcode"type="hidden"  id="p_id"   style="width:120px" value="${entity.taxcode}" size="30">
    <input name="entity.taxcode"type="text"  id="p_id" disabled style="width:120px" value="${entity.taxcode}" size="30"></td>
    <td width="154" align="right">纳税人姓名：</td>
    <td width="272"><input name="entity.taxplayer" type="text"  id="p_name" disabled  style="width:120px;" value="${entity.taxplayer}" size="30" readonly>
    <input name="entity.taxplayer" type="hidden"  id="p_name"  style="width:120px;" value="${entity.taxplayer}" size="30" >
    </td>
  </tr>
  <tr>
    <td height="35" align="right">所属行业：</td>
    <td colspan="2"><input name="entity.trade"type="text" id="bu_trade"  style="width:120px; " value="${entity.trade}" ></td>
    <td align="right">企业经营方式：</td>
    <td><input name="entity.managetype"type="text" id="bu_manageType"  style="width:120px; " value="${entity.managetype}" >      </td>
  </tr>
  <tr>
    <td height="33" align="right">企业类别：</td>
    <td colspan="2"><input name="entity.biztype" type="text" id="bu_businessType" style="width:120px; " value="${entity.biztype}" ></td>
    <td align="right">资产总额：</td>
    <td><input name="entity.amount"type="text" id="bu_amount"  style=" width:120px;" value="${entity.amount}"></td>
  </tr>
  <tr>
    <td height="36" align="right">注册资本：</td>
    <td colspan="2"><input name="entity.regcapital"type="text" id="p_workspace"  style=" width:120px;" value="${entity.regcapital}"></td>
    <td align="right">金额单位：</td>
    <td><input  style="width:120px; "type="text"  name="entity.captialtype"  value="万元"></td>
  </tr>
  <tr>
    <td height="38" align="right">征税方式：</td>
    <td colspan="2"><s:select list="{'查账征收','查定征收','查验征收','定期定额征收'}" name="entity.levytype" id="bu_levyType"  theme="simple"></s:select></td>
    <td align="right">联系方式(手机)：</td>
    <td><input name="entity.phone" type="text" id="p_callnumber" style=" width:120px;" onChange="isMobile(p_callnumber)" value="${entity.phone}"></td>
  </tr>
  <tr>
    <td height="36" align="right">&nbsp;</td>
    <td width="194" align="right"><label>
      <input type="submit" name="Submit" value="提交">
    </label></td>
    <td width="28" align="left">&nbsp;</td>
    <td><label>
      <input type="reset" name="Submit2" value="重置">
    </label></td>
    <td>&nbsp;</td>
  </tr>
</table>

    </form>
	</td>
  </tr>
</table>
  </div>
  

</div>
  </body>
</html>
